//
//  LeftViewController.m
//  UI_NavigationCtrollerHomework
//
//  Created by dllo on 16/7/21.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "LeftViewController.h"
#import "ViewController.h"
@interface LeftViewController ()

@end

@implementation LeftViewController

- (void)viewDidLoad {
    [super viewDidLoad];

      self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc]initWithTitle:@"→" style:UIBarButtonItemStylePlain target:self action:@selector(handleright:)];
      //去掉系统自带返回按钮
       self.navigationItem.hidesBackButton = YES;
      self.view.backgroundColor = [UIColor whiteColor];
}

- (void)handleright:(UIBarButtonItem *)right {
      
      CATransition *animation = [CATransition animation];
      
      [animation setDuration:0.3];
      
      [animation setType: kCATransitionMoveIn];
      
      [animation setSubtype: kCATransitionFromRight];
      
      [animation setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionDefault]];

      
      [self.navigationController.view.layer addAnimation:animation forKey:nil];
      
      

      [self.navigationController popViewControllerAnimated:NO];
      
      
      

}
//底部隐藏
- (void)viewWillAppear:(BOOL)animated

{
      
      [super viewWillAppear:animated];
      
      self.tabBarController.tabBar.hidden=YES;
      
}

- (void)viewWillDisappear:(BOOL)animated

{
      
      [super viewWillDisappear:animated];
      
      self.tabBarController.tabBar.hidden=NO;
      
}


@end
